package com.example.test.实体责任链;

import com.example.test.bean.User;

public abstract class AbstractHandel {

    private AbstractHandel nextHandel;

    public void setNextHandel(AbstractHandel abstractHandel) {
        this.nextHandel = abstractHandel;
    }

    public abstract boolean doHandel(User user);

    public void handel (User user){
        if (this.doHandel(user) && nextHandel !=null) {
            nextHandel.handel(user);
        }
    }
}
